import 'package:flutter/material.dart';

void main() => runApp(MyApp());

// 所有资源文件都需要在pubspec.yaml文件中配置
class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text(''),
        ),
        // 读取文件，需要异步
        body: FutureBuilder(
          future: DefaultAssetBundle.of(context).loadString('assets/file/a.txt'),
          builder: (context, snapshot) => Text(snapshot.data),
        ),
      ),
    );
  }
}
